####################################################################################

#What You See and What You Get
#This file conducts the the analysis of outputs from W1 and W2 surveys
#Code to create Tables, Figures, and data cited in the main text and appendix 
#using Routputs created by running the previous three files (see documentation)


####################################################################################

rm(list=ls())
library(AER)
library(tidyverse)
library(readxl)
library(lubridate)
library(sandwich)
library(xtable)
library(corrgram)
library(forcats)
library(estimatr)
library(fastDummies)
library(randomizr)
library(ANOVAreplication)
library(miceadds)
library(clubSandwich)
library(texreg)
options(scipen=6)

source("Code/functions.R")

#Table A1: Loading anonymized data
load("Routputs/out-a1.RData")
print(comment(out.a1))
print.xtable(xtable(out.a1$outa1a, 
                    hline.after = 0, only.contents = TRUE), type = "latex", 
             file = "Tables/tb-a1a.tex")
print.xtable(xtable(out.a1$outa1b, 
                    hline.after = 0, only.contents = TRUE), type = "latex", 
             file = "Tables/tb-a1b.tex")
#The remainder of Table A1 was done manually by the authors
